package com.beimin.evedata.hibernate;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.beimin.evedata.model.chr.ChrFaction;
import com.beimin.evedata.repository.ChrRepository;

public class HibChrRepository implements ChrRepository {
	private final SessionFactory sf;

	public HibChrRepository(SessionFactory sf) {
		this.sf = sf;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.beimin.evedata.repository.FactionRepository#getFaction(int)
	 */
	public ChrFaction getFaction(int factionID) {
		Session session = sf.getCurrentSession();
		return (ChrFaction) session.get(ChrFaction.class, factionID);
	}

}
